Imports Microsoft.Xna.Framework.Input.Touch

''' <summary>
''' Provides extension methods for the TouchCollection type.
''' </summary>
Public NotInheritable Class TouchCollectionExtensions
	Private Sub New()
	End Sub
	''' <summary>
	''' Determines if there are any touches on the screen.
	''' </summary>
	''' <param name="touchState">The current TouchCollection.</param>
	''' <returns>True if there are any touches in the Pressed or Moved state, false otherwise</returns>

    Public Shared Function AnyTouch(touchState As TouchCollection) As Boolean
        For Each location As TouchLocation In touchState
            If location.State = TouchLocationState.Pressed OrElse location.State = TouchLocationState.Moved Then
                Return True
            End If
        Next
        Return False
    End Function
End Class
